home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / etc / rc2.z / rc2
Text File  |  1992-04-03  |  1KB  |  82 lines

  1. #! /bin/sh
  2. #Tag 0x00000f00
  3. #ident "$Revision: 1.12 $"
  4.  
  5. #    "Run Commands" executed when the system is changing to init state 2,
  6. #    traditionally called "multi-user".
  7.  
  8. . /etc/TIMEZONE
  9.  
  10. #    Pickup start-up packages for mounts, daemons, services, etc.
  11. set `who -r`
  12. if [ $9 = "S" ]
  13. then
  14.     echo 'The system is coming up.  Please wait.'
  15.     BOOT=yes
  16.     if [ -f /etc/rc.d/PRESERVE ]    # historical segment for vi and ex
  17.     then
  18.         mv /etc/rc.d/PRESERVE /etc/init.d
  19.         ln /etc/init.d/PRESERVE /etc/rc2.d/S02PRESERVE
  20.     fi
  21.  
  22. elif [ $7 = "2" ]
  23. then
  24.     echo 'Changing to state 2.'
  25.     if [ -d /etc/rc2.d ]
  26.     then
  27.         for f in /etc/rc2.d/K*
  28.         {
  29.             if [ -s ${f} ]
  30.             then
  31.                 /bin/sh ${f} stop
  32.             fi
  33.         }
  34.     fi
  35. fi
  36.  
  37. # handle local mounts specially, rather than as part of a generic rc2.d
  38. # operation, so that if the some mounts fail, we can warn the user
  39. if [ -f /etc/mountall ]
  40. then
  41.     if /etc/mountall
  42.     then :
  43.     else
  44.         echo '\07Some filesystems failed to mount; may be unable to reach multiuser state'
  45.         sleep 5
  46.     fi
  47. fi
  48.  
  49. if [ -d /etc/rc2.d ]
  50. then
  51.     for f in /etc/rc2.d/S*
  52.     {
  53.         if [ -s ${f} ]
  54.         then
  55.             /bin/sh ${f} start
  56.         fi
  57.     }
  58. fi
  59. if [ "${BOOT}" = "yes" ]
  60. then
  61.     stty sane tab3 2>/dev/null
  62. fi
  63.  
  64. if [ "${BOOT}" = "yes" -a -d /etc/rc.d ]
  65. then
  66.     for f in `ls /etc/rc.d`
  67.     {
  68.         if [ ! -s /etc/init.d/${f} ]
  69.         then
  70.             /bin/sh /etc/rc.d/${f} 
  71.         fi
  72.     }
  73. fi
  74.  
  75. if [ "${BOOT}" = "yes" -a $7 = "2" ]
  76. then
  77.     echo 'The system is ready.'
  78. elif [ $7 = "2" ]
  79. then
  80.     echo 'Change to state 2 has been completed.'
  81. fi
  82.